<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="leanote,leanote.com">
<meta name="description" content="leanote, {{msg $ "moto"}}">
<meta name="author" content="leanote">

<title>{{.title}}</title>
<!-- Bootstrap core CSS -->
<link href="{{.siteUrl}}/css/bootstrap.css" rel="stylesheet">
<!-- 字体必须同一域 -->
{{if .set}}
<link href="{{.siteUrl}}/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
{{else}}
<link href="{{$.staticUrl}}/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
{{end}}
<link id="styleLink" href="{{.siteUrl}}/css/blog/{{if .userBlog.Style}}{{.userBlog.Style}}{{else}}blog_default{{end}}.css" rel="stylesheet">
<link href="{{.siteUrl}}/css/blog/comment.css" rel="stylesheet">
<script>
function log(o) {
}
</script>
<style>

</style>
</head>
<body>
<div id="headerAndNav" >
	<div id="headerContainer" class="container">
		<!-- 头部可放博客名, 导航 -->
		<div id="header">
			{{$userId := .userBlog.UserId.Hex}} <!-- 可不要了 -->
			{{$username := .userInfo.Username}}
			<h1>
				<a href="{{.indexUrl}}" id="logo">
				{{if .userBlog.Logo}}
				<img src="{{.userBlog.Logo}}" title="{{.userBlog.Title}}"/>
				{{else}}
					{{.userBlog.Title | raw}}
				{{end}}
				</a>
			</h1>
			<div id="blogDesc">
				{{.userBlog.SubTitle | raw}}
			</div>
		</div>
	</div>
	
	<!-- Static navbar -->
	<div class="navbar navbar-default">
	  <div class="container">
	    <div class="navbar-header">
	      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
	        <span class="sr-only">Toggle navigation</span>
	        <span class="icon-bar"></span>
	        <span class="icon-bar"></span>
	        <span class="icon-bar"></span>
	      </button>
	      <a class="navbar-brand" href="{{.indexUrl}}">
	      	{{if .userBlog.Logo}}
			<img src="{{.userBlog.Logo}}" title="{{.userBlog.Title}}"/>
			{{else}}
				{{.userBlog.Title | raw}}
			{{end}}
	      </a>
	    </div>
	    <div class="navbar-collapse collapse">
	      <ul class="nav navbar-nav">
	      	{{$navNotebookId := .notebookId}}
				<li class="{{if .index}}active{{end}}"><a href="{{.indexUrl}}">{{msg . "home"}}</a></li>
			{{range .notebooks}}
				{{$notebookId := .NotebookId.Hex}}
				<li class="{{if $navNotebookId}}{{if eq $navNotebookId $notebookId}}active{{else}}{{end}}{{end}}">
					<a href="{{$.cateUrl}}/{{$notebookId}}" 
					>{{.Title}}</a>
				</li>
			{{end}}
				<li class="{{if .aboutMe}}active{{end}}"><a href="{{.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
				<!-- 同源上传logo -->
				<li class="is-me {{if .set}}active{{end}} {{if not .isMe}}hide{{end}}" ><a href="{{$.siteUrl}}/blog/set/">{{msg . "blogSet"}}</a></li>
				<li><a href="{{$.noteUrl}}" class="is-me {{if not .isMe}}hide{{end}}">{{msg . "myNote"}}</a></li>
	      </ul>
	      <form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
	      	<div class="input-group">
			  	<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
		        <input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.key}}">
		  	</div>
	      </form>
	    </div><!--/.nav-collapse -->
	  </div>
	</div>
</div>

<script>
var UserInfo = {UserId: "{{$userId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
var indexUrl = "{{$.indexUrl}}";
var viewUrl = "{{$.viewUrl}}";
var blogUrl = "{{$.blogUrl}}";
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
</script>